<?php

class m131012_084449_create_table_product_brand extends CDbMigration
{
	public function up()
	{
            $this->execute("
                CREATE TABLE IF NOT EXISTS `product_brand` (
                    `id` int(11) NOT NULL AUTO_INCREMENT,
                    `name` varchar(200) COLLATE utf8_unicode_ci NOT NULL,
                    `createTime` int(11) NOT NULL,
                    PRIMARY KEY (`id`)
                ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
                
                ALTER TABLE  `product` ADD  `brandId` INT NULL DEFAULT  '0' AFTER  `categoryId`;
            ");
	}

	public function down()
	{
		echo "m131012_084449_create_table_product_brand does not support migration down.\n";
		return false;
	}

	/*
	// Use safeUp/safeDown to do migration with transaction
	public function safeUp()
	{
	}

	public function safeDown()
	{
	}
	*/
}